package com.amorcloud.pig.activity;

import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.amorcloud.pig.R;

public class UploadActivity extends BaseActivity implements View.OnClickListener {

    Button btnBase, btnWeaned, btnCheck, btnSell;

    @Override
    protected void init() {
        setContentView(R.layout.activity_upload);
        initCustomToolbar(this);
        initView();
    }

    private void initView() {
        btnBase = findViewById(R.id.btn_base_data);
        btnBase.setOnClickListener(this);
        btnWeaned = findViewById(R.id.btn_weaned_data);
        btnWeaned.setOnClickListener(this);
        btnCheck = findViewById(R.id.btn_check_data);
        btnCheck.setOnClickListener(this);
        btnSell = findViewById(R.id.btn_sell_data);
        btnSell.setOnClickListener(this);
    }

    private void initData() {

    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(this, UploadDetailActivity.class);
        intent.putExtra("title",getIntent().getStringExtra("title"));
        switch (v.getId()) {
            case R.id.btn_base_data:
                intent.putExtra("type","base");
                break;
            case R.id.btn_check_data:
                intent.putExtra("type","check");
                break;
            case R.id.btn_weaned_data:
                intent.putExtra("type","weaned");
                break;
            case R.id.btn_sell_data:
                intent.putExtra("type","sell");
                break;
            default:
                break;
        }
        startActivity(intent);
    }
}
